package mychat.client;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;

import mychat.vo.User;

public class Processor extends Thread {
	private boolean start = false;
	private DataOutputStream out;
	private DataInputStream in;

	public Processor(DataOutputStream out, DataInputStream in) {
		this.out = out;
		this.in = in;
		start = true;
	}

	public void sendMessage(String s) {
		if(start){
			
		}

	}

	public void run() {
		while (start) {
			try {
				String str = in.readUTF();
				System.out.println(str);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} finally {
				close();
				try {
					if (in != null)
						in.close();
				} catch (IOException e) {
				} finally {
					try {
						if (out != null)
							out.close();
					} catch (IOException e) {
					}
				}
			}
		}
	}

	public void close() {
		start = false;
	}

}
